@remarkablejames/editor 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/README.md +1 -1
  2. package/lib/{ActionMenuButton-NfiUDE60.cjs → ActionMenuButton-DI9_8wC0.cjs} +1 -1
  3. package/lib/{ActionMenuButton-CpmEfz31.js → ActionMenuButton-DL05l66z.js} +1 -1
  4. package/lib/Attachment.cjs +1 -1
  5. package/lib/Attachment.js +2 -2
  6. package/lib/Blockquote.cjs +1 -1
  7. package/lib/Blockquote.js +1 -1
  8. package/lib/Bold.cjs +1 -1
  9. package/lib/Bold.js +1 -1
  10. package/lib/BulletList.cjs +1 -1
  11. package/lib/BulletList.js +1 -1
  12. package/lib/Callout.cjs +1 -1
  13. package/lib/Callout.js +16 -15
  14. package/lib/Clear.cjs +1 -1
  15. package/lib/Clear.js +1 -1
  16. package/lib/Code.cjs +1 -1
  17. package/lib/Code.js +1 -1
  18. package/lib/CodeBlock.cjs +1 -1
  19. package/lib/CodeBlock.js +32 -31
  20. package/lib/CodeView.cjs +1 -1
  21. package/lib/CodeView.js +1 -1
  22. package/lib/Color.cjs +1 -1
  23. package/lib/Color.js +2 -2
  24. package/lib/Column.cjs +1 -1
  25. package/lib/Column.js +1 -1
  26. package/lib/{Drawer-DlgdaO_B.cjs → Drawer-DEzhWKwY.cjs} +1 -1
  27. package/lib/{Drawer-CayP4Ww4.js → Drawer-DhM1qM6R.js} +15 -15
  28. package/lib/Drawer.cjs +1 -1
  29. package/lib/Drawer.js +2 -2
  30. package/lib/Emoji.cjs +1 -1
  31. package/lib/Emoji.js +8 -8
  32. package/lib/Excalidraw.cjs +1 -1
  33. package/lib/Excalidraw.js +36 -36
  34. package/lib/ExportPdf.cjs +1 -1
  35. package/lib/ExportPdf.js +1 -1
  36. package/lib/ExportWord.cjs +1 -1
  37. package/lib/ExportWord.js +1 -1
  38. package/lib/FontFamily.cjs +1 -1
  39. package/lib/FontFamily.js +3 -3
  40. package/lib/FontSize.cjs +1 -1
  41. package/lib/FontSize.js +3 -3
  42. package/lib/Heading.cjs +1 -1
  43. package/lib/Heading.js +8 -8
  44. package/lib/Highlight.cjs +1 -1
  45. package/lib/Highlight.js +2 -2
  46. package/lib/History.cjs +1 -1
  47. package/lib/History.js +1 -1
  48. package/lib/HorizontalRule.cjs +1 -1
  49. package/lib/HorizontalRule.js +1 -1
  50. package/lib/{Iframe-CANdxSpV.cjs → Iframe-DbYJ82AI.cjs} +1 -1
  51. package/lib/{Iframe-C6Sb97KS.js → Iframe-yDX_zHls.js} +1 -1
  52. package/lib/Iframe.cjs +1 -1
  53. package/lib/Iframe.js +2 -2
  54. package/lib/Image.cjs +1 -1
  55. package/lib/Image.js +3 -3
  56. package/lib/ImageGif.cjs +1 -1
  57. package/lib/ImageGif.js +28 -28
  58. package/lib/ImportWord.cjs +1 -1
  59. package/lib/ImportWord.js +12 -12
  60. package/lib/{Indent-CcFe8py3.js → Indent-CA46zsbb.js} +1 -1
  61. package/lib/{Indent-DuB2U6Cs.cjs → Indent-CYaCq_Mv.cjs} +1 -1
  62. package/lib/Indent.cjs +1 -1
  63. package/lib/Indent.js +1 -1
  64. package/lib/Italic.cjs +1 -1
  65. package/lib/Italic.js +1 -1
  66. package/lib/Katex-Dh-kTBjf.cjs +4 -0
  67. package/lib/{Katex-Bp6AnIUF.js → Katex-g3ZS3zUf.js} +4 -3
  68. package/lib/Katex.cjs +1 -1
  69. package/lib/Katex.js +1 -1
  70. package/lib/LineHeight.cjs +1 -1
  71. package/lib/LineHeight.js +2 -2
  72. package/lib/Link.cjs +1 -1
  73. package/lib/Link.js +1 -1
  74. package/lib/{LinkEditBlock-C2zX0WVK.cjs → LinkEditBlock-ClqpI1FH.cjs} +1 -1
  75. package/lib/{LinkEditBlock-BiHumIJR.js → LinkEditBlock-qE5KHPQs.js} +7 -7
  76. package/lib/Mermaid-BmUChJSB.cjs +2 -0
  77. package/lib/{Mermaid-Dlx0XTJj.js → Mermaid-CefRECZY.js} +24 -23
  78. package/lib/Mermaid.cjs +1 -1
  79. package/lib/Mermaid.js +1 -1
  80. package/lib/MoreMark.cjs +1 -1
  81. package/lib/MoreMark.js +2 -2
  82. package/lib/OrderedList.cjs +1 -1
  83. package/lib/OrderedList.js +1 -1
  84. package/lib/PaywallSeparator.cjs +1 -1
  85. package/lib/PaywallSeparator.js +1 -1
  86. package/lib/SearchAndReplace.cjs +1 -1
  87. package/lib/SearchAndReplace.js +7 -7
  88. package/lib/SlashCommand.cjs +1 -1
  89. package/lib/SlashCommand.js +2 -2
  90. package/lib/{SlashCommandNodeView-DzmsYaNc.js → SlashCommandNodeView-BsIrWlhS.js} +5 -5
  91. package/lib/{SlashCommandNodeView-BfWNWGRr.cjs → SlashCommandNodeView-DpXsfGmo.cjs} +1 -1
  92. package/lib/Strike.cjs +1 -1
  93. package/lib/Strike.js +1 -1
  94. package/lib/{Table-BfM6ywrZ.cjs → Table-B-0TePQ3.cjs} +1 -1
  95. package/lib/{Table-IH34r4jd.js → Table-CG0nisk4.js} +2 -2
  96. package/lib/Table.cjs +1 -1
  97. package/lib/Table.js +1 -1
  98. package/lib/TaskList.cjs +1 -1
  99. package/lib/TaskList.js +1 -1
  100. package/lib/TextAlign.cjs +1 -1
  101. package/lib/TextAlign.js +2 -2
  102. package/lib/TextDirection.cjs +1 -1
  103. package/lib/TextDirection.js +2 -2
  104. package/lib/TextUnderline.cjs +1 -1
  105. package/lib/TextUnderline.js +1 -1
  106. package/lib/{Twitter-FVQKPaq6.js → Twitter-DlGSWdh7.js} +7 -7
  107. package/lib/{Twitter-axcoCgD7.cjs → Twitter-DvMmVNMF.cjs} +1 -1
  108. package/lib/Twitter.cjs +1 -1
  109. package/lib/Twitter.js +1 -1
  110. package/lib/Video.cjs +1 -1
  111. package/lib/Video.js +3 -3
  112. package/lib/bubble.cjs +3 -3
  113. package/lib/bubble.js +83 -81
  114. package/lib/components/RichTextProvider.d.ts +1 -1
  115. package/lib/{dropdown-menu-Ce2TorkG.js → dropdown-menu-D-mNjyKn.js} +1 -1
  116. package/lib/{dropdown-menu-DirUyRAI.cjs → dropdown-menu-gOopBX-L.cjs} +1 -1
  117. package/lib/index-CUnpdrCy.cjs +28 -0
  118. package/lib/{index-CnKgiZFQ.js → index-CelRl0mr.js} +1062 -1191
  119. package/lib/index.cjs +3 -3
  120. package/lib/index.js +61 -59
  121. package/lib/{popover-BdLwAlrM.cjs → popover-DEMkixfo.cjs} +1 -1
  122. package/lib/{popover-BzJyaFvy.js → popover-SMtif0E1.js} +1 -1
  123. package/lib/select-BqlizSg4.cjs +1 -0
  124. package/lib/select-Dc3RkAhQ.js +120 -0
  125. package/lib/{separator-D-fyzbfx.js → separator-DWLSmuSh.js} +14 -14
  126. package/lib/{separator-CoQaQmFK.cjs → separator-DuP4NoiV.cjs} +1 -1
  127. package/lib/textarea-C89l2GRG.cjs +1 -0
  128. package/lib/textarea-DvciwVxS.js +20 -0
  129. package/lib/theme.cjs +1 -1
  130. package/lib/theme.js +18 -18
  131. package/package.json +21 -32
  132. package/lib/Katex-DFU1unCm.cjs +0 -4
  133. package/lib/Mermaid-B8lQSOGn.cjs +0 -2
  134. package/lib/index-BynXHtjJ.cjs +0 -28
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  ## Run Locally
15
15
 
16
- Clone the project
16
+ Clone the project:
17
17
 
18
18
  ```bash
19
19
  git clone https://github.com/hunghg255/reactjs-tiptap-editor.git
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),c=require("./index-BynXHtjJ.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:i,...t},l)=>{var n;const x=c.icons[t.icon],r=h?a.Slot:c.Button;return e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(r,{className:"richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0","data-state":t!=null&&t.dataState?"on":"off",disabled:t==null?void 0:t.disabled,ref:l,variant:"ghost",...t,children:e.jsxs("div",{className:"richtext-flex richtext-h-full richtext-items-center richtext-font-normal",children:[(t==null?void 0:t.title)&&e.jsx("div",{className:"richtext-grow richtext-truncate richtext-text-left richtext-text-sm",children:t==null?void 0:t.title}),x&&e.jsx(x,{className:"richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500"})]})})}),i&&e.jsx(c.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[i&&e.jsx("div",{children:i}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:c.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
1
+ "use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),c=require("./index-CUnpdrCy.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:i,...t},l)=>{var n;const x=c.icons[t.icon],r=h?a.Slot:c.Button;return e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(r,{className:"richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0","data-state":t!=null&&t.dataState?"on":"off",disabled:t==null?void 0:t.disabled,ref:l,variant:"ghost",...t,children:e.jsxs("div",{className:"richtext-flex richtext-h-full richtext-items-center richtext-font-normal",children:[(t==null?void 0:t.title)&&e.jsx("div",{className:"richtext-grow richtext-truncate richtext-text-left richtext-text-sm",children:t==null?void 0:t.title}),x&&e.jsx(x,{className:"richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500"})]})})}),i&&e.jsx(c.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[i&&e.jsx("div",{children:i}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:c.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
2
  import { Slot as n } from "@radix-ui/react-slot";
3
3
  import r from "react";
4
- import { i as d, T as m, a as f, B as s, b as u, g } from "./index-CnKgiZFQ.js";
4
+ import { i as d, T as m, a as f, B as s, b as u, g } from "./index-CelRl0mr.js";
5
5
  import "./theme.js";
6
6
  const C = r.forwardRef(
7
7
  ({ asChild: x = !1, tooltip: i, ...t }, l) => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./clsx-CXbNJWDD.cjs");const e=require("./index-BynXHtjJ.cjs");require("react/jsx-runtime");require("react");require("./theme.cjs");exports.Attachment=e.Attachment;exports.RichTextAttachment=e.RichTextAttachment;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./clsx-CXbNJWDD.cjs");const e=require("./index-CUnpdrCy.cjs");require("react/jsx-runtime");require("react");require("./theme.cjs");exports.Attachment=e.Attachment;exports.RichTextAttachment=e.RichTextAttachment;
package/lib/Attachment.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import "./clsx-BUPZHhq3.js";
2
- import { a2 as p, a3 as e } from "./index-CnKgiZFQ.js";
2
+ import { Y as a, Z as e } from "./index-CelRl0mr.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "./theme.js";
6
6
  export {
7
- p as Attachment,
7
+ a as Attachment,
8
8
  e as RichTextAttachment
9
9
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./clsx-CXbNJWDD.cjs"),p=require("./jsx-runtime-C_NLcKys.cjs"),l=require("react/jsx-runtime"),a=require("./index-BynXHtjJ.cjs");require("react");require("./theme.cjs");var m=/^\s*>\s$/,g=c.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return p.h("blockquote",{...c.mergeAttributes(this.options.HTMLAttributes,t),children:p.h("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach(i=>{const u=e.renderChildren([i]).split(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./clsx-CXbNJWDD.cjs"),p=require("./jsx-runtime-C_NLcKys.cjs"),l=require("react/jsx-runtime"),a=require("./index-CUnpdrCy.cjs");require("react");require("./theme.cjs");var m=/^\s*>\s$/,g=c.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return p.h("blockquote",{...c.mergeAttributes(this.options.HTMLAttributes,t),children:p.h("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach(i=>{const u=e.renderChildren([i]).split(`
2
2
  `).map(r=>r.trim()===""?o:`${o} ${r}`);n.push(u.join(`
3
3
  `))}),n.join(`
4
4
  ${o}
package/lib/Blockquote.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { N as m, w as h, m as k } from "./clsx-BUPZHhq3.js";
2
2
  import { h as a } from "./jsx-runtime-CT7Pcg-t.js";
3
3
  import { jsx as d, Fragment as g } from "react/jsx-runtime";
4
- import { u as f, d as b, A as q } from "./index-CnKgiZFQ.js";
4
+ import { u as f, d as b, A as q } from "./index-CelRl0mr.js";
5
5
  import "react";
6
6
  import "./theme.js";
7
7
  var v = /^\s*>\s$/, B = m.create({
package/lib/Bold.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),u=require("./jsx-runtime-C_NLcKys.cjs"),r=require("./index-BynXHtjJ.cjs"),i=require("react/jsx-runtime");require("react");require("./theme.cjs");var y=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,B=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,k=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,v=o.Mark.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return u.h("strong",{...o.mergeAttributes(this.options.HTMLAttributes,t),children:u.h("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[o.markInputRule({find:y,type:this.type}),o.markInputRule({find:B,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:_,type:this.type}),o.markPasteRule({find:k,type:this.type})]}});function M(){const t=r.useButtonProps(l.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:s=void 0,tooltipOptions:c={},action:a=void 0,isActive:p=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:g,disabled:d,update:m}=r.useToggleActive(p),h=()=>{d||a&&(a(),m())};return t?i.jsx(r.ActionButton,{action:h,dataState:g,disabled:d,icon:e,shortcutKeys:s,tooltip:n,tooltipOptions:c}):i.jsx(i.Fragment,{})}const l=v.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:n,extension:s})=>({component:r.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:s.options.shortcutKeys??["mod","B"],tooltip:n("editor.bold.tooltip")}})}}});exports.Bold=l;exports.RichTextBold=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),u=require("./jsx-runtime-C_NLcKys.cjs"),r=require("./index-CUnpdrCy.cjs"),i=require("react/jsx-runtime");require("react");require("./theme.cjs");var y=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,B=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,k=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,v=o.Mark.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return u.h("strong",{...o.mergeAttributes(this.options.HTMLAttributes,t),children:u.h("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[o.markInputRule({find:y,type:this.type}),o.markInputRule({find:B,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:_,type:this.type}),o.markPasteRule({find:k,type:this.type})]}});function M(){const t=r.useButtonProps(l.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:s=void 0,tooltipOptions:c={},action:a=void 0,isActive:p=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:g,disabled:d,update:m}=r.useToggleActive(p),h=()=>{d||a&&(a(),m())};return t?i.jsx(r.ActionButton,{action:h,dataState:g,disabled:d,icon:e,shortcutKeys:s,tooltip:n,tooltipOptions:c}):i.jsx(i.Fragment,{})}const l=v.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:n,extension:s})=>({component:r.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:s.options.shortcutKeys??["mod","B"],tooltip:n("editor.bold.tooltip")}})}}});exports.Bold=l;exports.RichTextBold=M;
package/lib/Bold.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { M as _, e as a, f as i, m as y } from "./clsx-BUPZHhq3.js";
2
2
  import { h as d } from "./jsx-runtime-CT7Pcg-t.js";
3
- import { u as f, d as M, A as l } from "./index-CnKgiZFQ.js";
3
+ import { u as f, d as M, A as l } from "./index-CelRl0mr.js";
4
4
  import { jsx as u, Fragment as v } from "react/jsx-runtime";
5
5
  import "react";
6
6
  import "./theme.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-BCzvbrf5.cjs"),s=require("react/jsx-runtime"),n=require("./index-BynXHtjJ.cjs");require("react");require("./theme.cjs");function h(){const t=n.useButtonProps(l.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:r={},action:c=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:a,disabled:u,update:p}=n.useToggleActive(d),m=()=>{u||c&&(c(),p())};return t?s.jsx(n.ActionButton,{action:m,dataState:a,disabled:u,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:r}):s.jsx(s.Fragment,{})}const l=v.BulletList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:i,extension:o})=>({componentProps:{action:()=>e.commands.toggleBulletList(),isActive:()=>e.isActive("bulletList"),disabled:!1,shortcutKeys:o.options.shortcutKeys??["shift","mod","8"],icon:"List",tooltip:i("editor.bulletlist.tooltip")}})}}});exports.BulletList=l;exports.RichTextBulletList=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-BCzvbrf5.cjs"),s=require("react/jsx-runtime"),n=require("./index-CUnpdrCy.cjs");require("react");require("./theme.cjs");function h(){const t=n.useButtonProps(l.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:r={},action:c=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:a,disabled:u,update:p}=n.useToggleActive(d),m=()=>{u||c&&(c(),p())};return t?s.jsx(n.ActionButton,{action:m,dataState:a,disabled:u,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:r}):s.jsx(s.Fragment,{})}const l=v.BulletList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:i,extension:o})=>({componentProps:{action:()=>e.commands.toggleBulletList(),isActive:()=>e.isActive("bulletList"),disabled:!1,shortcutKeys:o.options.shortcutKeys??["shift","mod","8"],icon:"List",tooltip:i("editor.bulletlist.tooltip")}})}}});exports.BulletList=l;exports.RichTextBulletList=h;
package/lib/BulletList.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { B as d } from "./index-DZj2z9_1.js";
2
2
  import { jsx as c, Fragment as m } from "react/jsx-runtime";
3
- import { u as f, d as v, A } from "./index-CnKgiZFQ.js";
3
+ import { u as f, d as v, A } from "./index-CelRl0mr.js";
4
4
  import "react";
5
5
  import "./theme.js";
6
6
  function y() {
package/lib/Callout.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./clsx-CXbNJWDD.cjs"),e=require("./index-BynXHtjJ.cjs"),t=require("react/jsx-runtime"),h=require("react");require("./theme.cjs");const c=require("lucide-react"),O=require("./index-DgOXAdKt.cjs"),m=[{value:"note",label:"Note",icon:c.Info,color:"#1f6feb",background:"#1f6feb1f"},{value:"tip",label:"Tip",icon:c.Lightbulb,color:"#238636",background:"#2386361f"},{value:"important",label:"Important",icon:c.AlertCircle,color:"#ab7df8",background:"#ab7df81f"},{value:"warning",label:"Warning",icon:c.TriangleAlert,color:"#d29922",background:"#d299221f"},{value:"caution",label:"Caution",icon:c.OctagonAlert,color:"#f85149",background:"#f851491f"}];function k({node:l}){const{type:o="note",title:i="",body:s=""}=l.attrs,u=(m.find(d=>d.value===o)||m[0]).icon;return t.jsx(a.NodeViewWrapper,{children:t.jsxs("div",{className:a.clsx("richtext-relative richtext-my-4 richtext-rounded-lg richtext-border richtext-p-4",{"richtext-bg-[#1f6feb1f] richtext-border-[#1f6feb]":o==="note","richtext-bg-[#2386361f] richtext-border-[#238636]":o==="tip","richtext-bg-[#ab7df81f] richtext-border-[#ab7df8]":o==="important","richtext-bg-[#d299221f] richtext-border-[#d29922]":o==="warning","richtext-bg-[#f851491f] richtext-border-[#f85149]":o==="caution"}),children:[t.jsxs("div",{className:a.clsx("richtext-mb-2 richtext-flex richtext-items-center richtext-gap-2",{"richtext-text-[#1f6feb]":o==="note","richtext-text-[#238636]":o==="tip","richtext-text-[#ab7df8]":o==="important","richtext-text-[#d29922]":o==="warning","richtext-text-[#f85149]":o==="caution"}),children:[t.jsx(u,{className:"richtext-size-5"}),t.jsx("span",{className:"richtext-font-semibold",children:i})]}),s&&t.jsx("p",{className:"richtext-pl-[28px]",children:s})]})})}const w=[{value:"note",label:"Note",icon:"Info"},{value:"tip",label:"Tip",icon:"Lightbulb"},{value:"important",label:"Important",icon:"AlertCircle"},{value:"warning",label:"Warning",icon:"TriangleAlert"},{value:"caution",label:"Caution",icon:"OctagonAlert"}];function M(){const{t:l}=O.useLocale(),o=e.useEditorInstance(),i=e.useButtonProps(j.name),[s,n]=h.useState(!1),[u,d]=h.useState("note"),[p,b]=h.useState(""),[g,f]=h.useState(""),{icon:C=void 0,tooltip:y=void 0,shortcutKeys:T=void 0,tooltipOptions:A={},isActive:L=void 0}=(i==null?void 0:i.componentProps)??{},{dataState:N,disabled:v}=e.useToggleActive(L),S=()=>{o&&(o.chain().focus().setCallout({type:u,title:p,body:g}).run(),n(!1),d("note"),b(""),f(""))},I=()=>{v||n(!0)};return i?t.jsxs(e.Dialog,{onOpenChange:n,open:s,children:[t.jsx(e.DialogTrigger,{asChild:!0,children:t.jsx(e.ActionButton,{action:I,dataState:N,disabled:v,icon:C,shortcutKeys:T,tooltip:y,tooltipOptions:A})}),t.jsxs(e.DialogContent,{children:[t.jsx(e.DialogTitle,{children:l("editor.callout.dialog.title")}),t.jsxs("div",{className:"richtext-space-y-4 richtext-py-4",children:[t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(e.Label,{children:l("editor.callout.dialog.type")}),t.jsxs(e.Select,{onValueChange:d,value:u,children:[t.jsx(e.SelectTrigger,{children:t.jsx(e.SelectValue,{placeholder:l("editor.callout.dialog.type.placeholder")})}),t.jsx(e.SelectContent,{children:w.map(r=>t.jsx(e.SelectItem,{value:r.value,children:l(`editor.callout.type.${r.value}`)},r.value))})]})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(e.Label,{children:l("editor.callout.dialog.title.label")}),t.jsx(e.Input,{onChange:r=>b(r.target.value),placeholder:l("editor.callout.dialog.title.placeholder"),value:p})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(e.Label,{children:l("editor.callout.dialog.body.label")}),t.jsx(e.Input,{onChange:r=>f(r.target.value),placeholder:l("editor.callout.dialog.body.placeholder"),value:g})]})]}),t.jsxs(e.DialogFooter,{children:[t.jsx(e.Button,{onClick:()=>n(!1),variant:"outline",children:l("editor.callout.dialog.button.cancel")}),t.jsx(e.Button,{onClick:S,children:l("editor.callout.dialog.button.apply")})]})]})]}):t.jsx(t.Fragment,{})}function x(l){return o=>o.getAttribute(l)}const j=a.Node3.create({name:"callout",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addOptions(){var l;return{...(l=this.parent)==null?void 0:l.call(this),HTMLAttributes:{class:"callout"},button:({editor:o,t:i})=>({component:e.ActionButton,componentProps:{action:()=>!0,isActive:()=>o.isActive("callout"),disabled:!1,icon:"Callout",tooltip:i("editor.callout.tooltip")}})}},parseHTML(){return[{tag:"div.callout"}]},renderHTML({HTMLAttributes:l}){return["div",a.mergeAttributes(this.options&&this.options.HTMLAttributes||{},l)]},addAttributes(){return{type:{default:"",parseHTML:x("type")},title:{default:"",parseHTML:x("title")},body:{default:"",parseHTML:x("body")}}},addCommands(){return{setCallout:l=>({chain:o})=>o().insertContent({type:this.name,attrs:l}).run()}},addNodeView(){return a.ReactNodeViewRenderer(k)}});exports.Callout=j;exports.RichTextCallout=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./clsx-CXbNJWDD.cjs"),o=require("./index-CUnpdrCy.cjs"),t=require("react/jsx-runtime"),x=require("react");require("./theme.cjs");const c=require("lucide-react"),s=require("./select-BqlizSg4.cjs"),k=require("./index-DgOXAdKt.cjs"),j=[{value:"note",label:"Note",icon:c.Info,color:"#1f6feb",background:"#1f6feb1f"},{value:"tip",label:"Tip",icon:c.Lightbulb,color:"#238636",background:"#2386361f"},{value:"important",label:"Important",icon:c.AlertCircle,color:"#ab7df8",background:"#ab7df81f"},{value:"warning",label:"Warning",icon:c.TriangleAlert,color:"#d29922",background:"#d299221f"},{value:"caution",label:"Caution",icon:c.OctagonAlert,color:"#f85149",background:"#f851491f"}];function q({node:e}){const{type:l="note",title:r="",body:u=""}=e.attrs,d=(j.find(h=>h.value===l)||j[0]).icon;return t.jsx(a.NodeViewWrapper,{children:t.jsxs("div",{className:a.clsx("richtext-relative richtext-my-4 richtext-rounded-lg richtext-border richtext-p-4",{"richtext-bg-[#1f6feb1f] richtext-border-[#1f6feb]":l==="note","richtext-bg-[#2386361f] richtext-border-[#238636]":l==="tip","richtext-bg-[#ab7df81f] richtext-border-[#ab7df8]":l==="important","richtext-bg-[#d299221f] richtext-border-[#d29922]":l==="warning","richtext-bg-[#f851491f] richtext-border-[#f85149]":l==="caution"}),children:[t.jsxs("div",{className:a.clsx("richtext-mb-2 richtext-flex richtext-items-center richtext-gap-2",{"richtext-text-[#1f6feb]":l==="note","richtext-text-[#238636]":l==="tip","richtext-text-[#ab7df8]":l==="important","richtext-text-[#d29922]":l==="warning","richtext-text-[#f85149]":l==="caution"}),children:[t.jsx(d,{className:"richtext-size-5"}),t.jsx("span",{className:"richtext-font-semibold",children:r})]}),u&&t.jsx("p",{className:"richtext-pl-[28px]",children:u})]})})}const w=[{value:"note",label:"Note",icon:"Info"},{value:"tip",label:"Tip",icon:"Lightbulb"},{value:"important",label:"Important",icon:"AlertCircle"},{value:"warning",label:"Warning",icon:"TriangleAlert"},{value:"caution",label:"Caution",icon:"OctagonAlert"}];function M(){const{t:e}=k.useLocale(),l=o.useEditorInstance(),r=o.useButtonProps(C.name),[u,n]=x.useState(!1),[d,h]=x.useState("note"),[b,g]=x.useState(""),[f,v]=x.useState(""),{icon:y=void 0,tooltip:T=void 0,shortcutKeys:A=void 0,tooltipOptions:L={},isActive:N=void 0}=(r==null?void 0:r.componentProps)??{},{dataState:S,disabled:m}=o.useToggleActive(N),I=()=>{l&&(l.chain().focus().setCallout({type:d,title:b,body:f}).run(),n(!1),h("note"),g(""),v(""))},O=()=>{m||n(!0)};return r?t.jsxs(o.Dialog,{onOpenChange:n,open:u,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:O,dataState:S,disabled:m,icon:y,shortcutKeys:A,tooltip:T,tooltipOptions:L})}),t.jsxs(o.DialogContent,{children:[t.jsx(o.DialogTitle,{children:e("editor.callout.dialog.title")}),t.jsxs("div",{className:"richtext-space-y-4 richtext-py-4",children:[t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(o.Label,{children:e("editor.callout.dialog.type")}),t.jsxs(s.Select,{onValueChange:h,value:d,children:[t.jsx(s.SelectTrigger,{children:t.jsx(s.SelectValue,{placeholder:e("editor.callout.dialog.type.placeholder")})}),t.jsx(s.SelectContent,{children:w.map(i=>t.jsx(s.SelectItem,{value:i.value,children:e(`editor.callout.type.${i.value}`)},i.value))})]})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(o.Label,{children:e("editor.callout.dialog.title.label")}),t.jsx(o.Input,{onChange:i=>g(i.target.value),placeholder:e("editor.callout.dialog.title.placeholder"),value:b})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(o.Label,{children:e("editor.callout.dialog.body.label")}),t.jsx(o.Input,{onChange:i=>v(i.target.value),placeholder:e("editor.callout.dialog.body.placeholder"),value:f})]})]}),t.jsxs(o.DialogFooter,{children:[t.jsx(o.Button,{onClick:()=>n(!1),variant:"outline",children:e("editor.callout.dialog.button.cancel")}),t.jsx(o.Button,{onClick:I,children:e("editor.callout.dialog.button.apply")})]})]})]}):t.jsx(t.Fragment,{})}function p(e){return l=>l.getAttribute(e)}const C=a.Node3.create({name:"callout",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"callout"},button:({editor:l,t:r})=>({component:o.ActionButton,componentProps:{action:()=>!0,isActive:()=>l.isActive("callout"),disabled:!1,icon:"Callout",tooltip:r("editor.callout.tooltip")}})}},parseHTML(){return[{tag:"div.callout"}]},renderHTML({HTMLAttributes:e}){return["div",a.mergeAttributes(this.options&&this.options.HTMLAttributes||{},e)]},addAttributes(){return{type:{default:"",parseHTML:p("type")},title:{default:"",parseHTML:p("title")},body:{default:"",parseHTML:p("body")}}},addCommands(){return{setCallout:e=>({chain:l})=>l().insertContent({type:this.name,attrs:e}).run()}},addNodeView(){return a.ReactNodeViewRenderer(q)}});exports.Callout=C;exports.RichTextCallout=M;
package/lib/Callout.js CHANGED
@@ -1,43 +1,44 @@
1
1
  import { h as D, j as x, N as H, k as M, m as B } from "./clsx-BUPZHhq3.js";
2
- import { h as V, u as j, d as P, D as E, m as R, A as T, n as W, o as F, L as u, S as U, p as Y, q as _, r as $, s as q, j as v, t as z, B as C } from "./index-CnKgiZFQ.js";
3
- import { jsx as o, jsxs as l, Fragment as K } from "react/jsx-runtime";
2
+ import { h as V, u as j, d as P, D as E, m as R, A as T, n as W, o as F, L as u, j as v, p as U, B as C } from "./index-CelRl0mr.js";
3
+ import { jsx as o, jsxs as l, Fragment as Y } from "react/jsx-runtime";
4
4
  import { useState as s } from "react";
5
5
  import "./theme.js";
6
- import { Info as G, Lightbulb as J, AlertCircle as Q, TriangleAlert as X, OctagonAlert as Z } from "lucide-react";
6
+ import { Info as _, Lightbulb as $, AlertCircle as z, TriangleAlert as K, OctagonAlert as q } from "lucide-react";
7
+ import { S as G, a as J, b as Q, c as X, d as Z } from "./select-Dc3RkAhQ.js";
7
8
  import { u as tt } from "./index-BGd2HiwP.js";
8
9
  const y = [
9
10
  {
10
11
  value: "note",
11
12
  label: "Note",
12
- icon: G,
13
+ icon: _,
13
14
  color: "#1f6feb",
14
15
  background: "#1f6feb1f"
15
16
  },
16
17
  {
17
18
  value: "tip",
18
19
  label: "Tip",
19
- icon: J,
20
+ icon: $,
20
21
  color: "#238636",
21
22
  background: "#2386361f"
22
23
  },
23
24
  {
24
25
  value: "important",
25
26
  label: "Important",
26
- icon: Q,
27
+ icon: z,
27
28
  color: "#ab7df8",
28
29
  background: "#ab7df81f"
29
30
  },
30
31
  {
31
32
  value: "warning",
32
33
  label: "Warning",
33
- icon: X,
34
+ icon: K,
34
35
  color: "#d29922",
35
36
  background: "#d299221f"
36
37
  },
37
38
  {
38
39
  value: "caution",
39
40
  label: "Caution",
40
- icon: Z,
41
+ icon: q,
41
42
  color: "#f85149",
42
43
  background: "#f851491f"
43
44
  }
@@ -86,7 +87,7 @@ const ot = [
86
87
  { value: "warning", label: "Warning", icon: "TriangleAlert" },
87
88
  { value: "caution", label: "Caution", icon: "OctagonAlert" }
88
89
  ];
89
- function ut() {
90
+ function ht() {
90
91
  const { t } = tt(), e = V(), a = j(lt.name), [n, i] = s(!1), [c, d] = s("note"), [p, b] = s(""), [g, f] = s(""), {
91
92
  icon: A = void 0,
92
93
  tooltip: N = void 0,
@@ -116,9 +117,9 @@ function ut() {
116
117
  /* @__PURE__ */ l("div", { className: "richtext-space-y-4 richtext-py-4", children: [
117
118
  /* @__PURE__ */ l("div", { className: "richtext-space-y-2", children: [
118
119
  /* @__PURE__ */ o(u, { children: t("editor.callout.dialog.type") }),
119
- /* @__PURE__ */ l(U, { onValueChange: d, value: c, children: [
120
- /* @__PURE__ */ o(Y, { children: /* @__PURE__ */ o(_, { placeholder: t("editor.callout.dialog.type.placeholder") }) }),
121
- /* @__PURE__ */ o($, { children: ot.map((r) => /* @__PURE__ */ o(q, { value: r.value, children: t(`editor.callout.type.${r.value}`) }, r.value)) })
120
+ /* @__PURE__ */ l(G, { onValueChange: d, value: c, children: [
121
+ /* @__PURE__ */ o(J, { children: /* @__PURE__ */ o(Q, { placeholder: t("editor.callout.dialog.type.placeholder") }) }),
122
+ /* @__PURE__ */ o(X, { children: ot.map((r) => /* @__PURE__ */ o(Z, { value: r.value, children: t(`editor.callout.type.${r.value}`) }, r.value)) })
122
123
  ] })
123
124
  ] }),
124
125
  /* @__PURE__ */ l("div", { className: "richtext-space-y-2", children: [
@@ -144,12 +145,12 @@ function ut() {
144
145
  )
145
146
  ] })
146
147
  ] }),
147
- /* @__PURE__ */ l(z, { children: [
148
+ /* @__PURE__ */ l(U, { children: [
148
149
  /* @__PURE__ */ o(C, { onClick: () => i(!1), variant: "outline", children: t("editor.callout.dialog.button.cancel") }),
149
150
  /* @__PURE__ */ o(C, { onClick: w, children: t("editor.callout.dialog.button.apply") })
150
151
  ] })
151
152
  ] })
152
- ] }) : /* @__PURE__ */ o(K, {});
153
+ ] }) : /* @__PURE__ */ o(Y, {});
153
154
  }
154
155
  function h(t) {
155
156
  return (e) => e.getAttribute(t);
@@ -220,5 +221,5 @@ const lt = /* @__PURE__ */ H.create({
220
221
  });
221
222
  export {
222
223
  lt as Callout,
223
- ut as RichTextCallout
224
+ ht as RichTextCallout
224
225
  };
package/lib/Clear.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),i=require("./index-BynXHtjJ.cjs");function v(){const t=i.useButtonProps(s.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:a=void 0,tooltipOptions:u={},action:c=void 0,isActive:l=void 0}=(t==null?void 0:t.componentProps)??{},{disabled:r}=i.useActive(l),d=()=>{r||c&&c()};return t?n.jsx(i.ActionButton,{action:d,disabled:r,icon:e,shortcutKeys:a,tooltip:o,tooltipOptions:u}):n.jsx(n.Fragment,{})}const s=p.Node3.create({name:"clear",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:o})=>({componentProps:{action:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),isActive:()=>e.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:o("editor.clear.tooltip")}})}}});exports.Clear=s;exports.RichTextClear=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),i=require("./index-CUnpdrCy.cjs");function v(){const t=i.useButtonProps(s.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:a=void 0,tooltipOptions:u={},action:c=void 0,isActive:l=void 0}=(t==null?void 0:t.componentProps)??{},{disabled:r}=i.useActive(l),d=()=>{r||c&&c()};return t?n.jsx(i.ActionButton,{action:d,disabled:r,icon:e,shortcutKeys:a,tooltip:o,tooltipOptions:u}):n.jsx(n.Fragment,{})}const s=p.Node3.create({name:"clear",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:o})=>({componentProps:{action:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),isActive:()=>e.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:o("editor.clear.tooltip")}})}}});exports.Clear=s;exports.RichTextClear=v;
package/lib/Clear.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { N as l } from "./clsx-BUPZHhq3.js";
2
2
  import { jsx as r, Fragment as p } from "react/jsx-runtime";
3
- import { u as d, e as m, A as f } from "./index-CnKgiZFQ.js";
3
+ import { u as d, e as m, A as f } from "./index-CelRl0mr.js";
4
4
  function x() {
5
5
  const o = d(v.name), {
6
6
  icon: t = void 0,
package/lib/Code.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),i=require("react/jsx-runtime"),s=require("./index-BynXHtjJ.cjs");require("react");require("./theme.cjs");var h=/(^|[^`])`([^`]+)`(?!`)$/,x=/(^|[^`])`([^`]+)`(?!`)/g,C=o.Mark.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",o.mergeAttributes(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[o.markInputRule({find:h,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:x,type:this.type})]}});function v(){const e=s.useButtonProps(u.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:d=void 0,isActive:p=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:l,disabled:a,update:m}=s.useToggleActive(p),g=()=>{a||d&&(d(),m())};return e?i.jsx(s.ActionButton,{action:g,dataState:l,disabled:a,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):i.jsx(i.Fragment,{})}const u=C.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r,extension:n})=>({componentProps:{action:()=>t.commands.toggleCode(),isActive:()=>t.isActive("code"),disabled:!t.can().toggleCode(),icon:"Code",shortcutKeys:n.options.shortcutKeys??["mod","E"],tooltip:r("editor.code.tooltip")}})}}});exports.Code=u;exports.RichTextCode=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),i=require("react/jsx-runtime"),s=require("./index-CUnpdrCy.cjs");require("react");require("./theme.cjs");var h=/(^|[^`])`([^`]+)`(?!`)$/,x=/(^|[^`])`([^`]+)`(?!`)/g,C=o.Mark.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",o.mergeAttributes(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[o.markInputRule({find:h,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:x,type:this.type})]}});function v(){const e=s.useButtonProps(u.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:d=void 0,isActive:p=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:l,disabled:a,update:m}=s.useToggleActive(p),g=()=>{a||d&&(d(),m())};return e?i.jsx(s.ActionButton,{action:g,dataState:l,disabled:a,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):i.jsx(i.Fragment,{})}const u=C.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r,extension:n})=>({componentProps:{action:()=>t.commands.toggleCode(),isActive:()=>t.isActive("code"),disabled:!t.can().toggleCode(),icon:"Code",shortcutKeys:n.options.shortcutKeys??["mod","E"],tooltip:r("editor.code.tooltip")}})}}});exports.Code=u;exports.RichTextCode=v;
package/lib/Code.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { M as m, e as l, f as g, m as h } from "./clsx-BUPZHhq3.js";
2
2
  import { jsx as a, Fragment as M } from "react/jsx-runtime";
3
- import { u as v, d as C, A as f } from "./index-CnKgiZFQ.js";
3
+ import { u as v, d as C, A as f } from "./index-CelRl0mr.js";
4
4
  import "react";
5
5
  import "./theme.js";
6
6
  var k = /(^|[^`])`([^`]+)`(?!`)$/, x = /(^|[^`])`([^`]+)`(?!`)/g, y = m.create({
package/lib/CodeBlock.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./clsx-CXbNJWDD.cjs"),r=require("react/jsx-runtime"),i=require("./index-BynXHtjJ.cjs"),d=require("react");require("./theme.cjs");const w=require("prism-code-editor-lightweight"),j=require("prism-code-editor-lightweight/commands"),S=require("prism-code-editor-lightweight/cursor"),T=require("prism-code-editor-lightweight/guides"),I=require("prism-code-editor-lightweight/highlight-brackets"),B=require("prism-code-editor-lightweight/match-brackets"),R=require("prism-code-editor-lightweight/match-tags"),E=require("./delete-node-CosiBes5.cjs");require("prism-code-editor-lightweight/prism/languages/bash");require("prism-code-editor-lightweight/prism/languages/css");require("prism-code-editor-lightweight/prism/languages/css-extras");require("prism-code-editor-lightweight/prism/languages/ini");require("prism-code-editor-lightweight/prism/languages/kotlin");require("prism-code-editor-lightweight/prism/languages/xml");require("prism-code-editor-lightweight/prism/languages/markup");require("prism-code-editor-lightweight/prism/languages/r");require("prism-code-editor-lightweight/prism/languages/basic");require("prism-code-editor-lightweight/prism/languages/vbnet");require("prism-code-editor-lightweight/prism/languages/c");require("prism-code-editor-lightweight/prism/languages/opencl");require("prism-code-editor-lightweight/prism/languages/diff");require("prism-code-editor-lightweight/prism/languages/java");require("prism-code-editor-lightweight/prism/languages/less");require("prism-code-editor-lightweight/prism/languages/objectivec");require("prism-code-editor-lightweight/prism/languages/ruby");require("prism-code-editor-lightweight/prism/languages/sql");require("prism-code-editor-lightweight/prism/languages/wasm");require("prism-code-editor-lightweight/prism/languages/cpp");require("prism-code-editor-lightweight/prism/languages/go");require("prism-code-editor-lightweight/prism/languages/javascript");require("prism-code-editor-lightweight/prism/languages/js-templates");require("prism-code-editor-lightweight/prism/languages/jsx");require("prism-code-editor-lightweight/prism/languages/lua");require("prism-code-editor-lightweight/prism/languages/perl");require("prism-code-editor-lightweight/prism/languages/python");require("prism-code-editor-lightweight/prism/languages/rust");require("prism-code-editor-lightweight/prism/languages/swift");require("prism-code-editor-lightweight/prism/languages/clike");require("prism-code-editor-lightweight/prism/languages/csharp");require("prism-code-editor-lightweight/prism/languages/graphql");require("prism-code-editor-lightweight/prism/languages/json");require("prism-code-editor-lightweight/prism/languages/makefile");require("prism-code-editor-lightweight/prism/languages/scss");require("prism-code-editor-lightweight/prism/languages/typescript");require("prism-code-editor-lightweight/prism/languages/tsx");require("prism-code-editor-lightweight/prism/languages/yaml");require("prism-code-editor-lightweight/prism/languages/regex");require("prism-code-editor-lightweight/prism/languages/php");require("prism-code-editor-lightweight/prism/languages/markdown");function z(){const e=i.useButtonProps(q.name),{icon:c=void 0,tooltip:o=void 0,tooltipOptions:x={},action:n=void 0,isActive:h=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:l,disabled:m,update:g}=i.useToggleActive(h),v=()=>{m||n&&(n(),g())};return e?r.jsx(i.ActionButton,{action:v,dataState:l,disabled:m,icon:c,tooltip:o,tooltipOptions:x}):r.jsx(r.Fragment,{})}const L="_wrap_1x3wi_1",M="_blockInfoEditable_1x3wi_30",p={wrap:L,blockInfoEditable:M},b=[{value:"plaintext",label:"plaintext"},{value:"javascript",label:"JavaScript"},{value:"typescript",label:"TypeScript"},{value:"html",label:"HTML"},{value:"css",label:"CSS"},{value:"python",label:"Python"},{value:"java",label:"Java"},{value:"cpp",label:"C++"},{value:"go",label:"Go"},{value:"rust",label:"Rust"},{value:"sql",label:"SQL"},{value:"json",label:"JSON"},{value:"yaml",label:"YAML"},{value:"markdown",label:"Markdown"},{value:"bash",label:"Bash"},{value:"php",label:"PHP"}],f=[2,4,8];function W(e){const c=i.useEditableEditor(),o=d.useRef(null),x=d.useCallback(()=>E.deleteNode(q.name,e==null?void 0:e.editor),[e==null?void 0:e.editor]),n=d.useRef(null),h=e.node.attrs.code||e.node.textContent||"",l=d.useCallback(t=>{t==null||t.stopPropagation(),setTimeout(()=>{var a,u,k;(k=(u=(a=n.current)==null?void 0:a.textarea)==null?void 0:u.focus)==null||k.call(u)},0)},[]),m=async()=>{if(h)try{if(navigator.clipboard)await navigator.clipboard.writeText(h);else{const t=document.createElement("textarea");t.value=h,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}}catch(t){console.error("Error:",t)}finally{l()}},g=()=>{e.updateAttributes({lineNumbers:!e.node.attrs.lineNumbers}),l()},v=()=>{e.updateAttributes({wordWrap:!e.node.attrs.wordWrap}),l()},C=t=>{const a={...t};return a.language&&!b.some(u=>u.value===a.language)&&(a.language="plaintext",e.updateAttributes({language:"plaintext"})),a},A=d.useCallback(t=>{l(t)},[l]);return d.useEffect(()=>{if(o.current){const t=C(e.node.attrs);n.current=w.createEditor(o.current,{readOnly:!c,language:t.language||"plaintext",tabSize:t.tabSize??2,lineNumbers:t.lineNumbers??!0,wordWrap:t.wordWrap??!1,value:h,rtl:!1,onUpdate(a){queueMicrotask(()=>{e.updateAttributes({code:a})})}}),n.current.addExtensions(B.matchBrackets(),R.matchTags(),T.indentGuides(),I.highlightBracketPairs(),S.cursorPosition(),j.defaultCommands(),j.editHistory()),e.node.attrs.shouldFocus&&setTimeout(()=>{l(),e.updateAttributes({shouldFocus:!1})},0)}return()=>{var t,a;(t=n.current)!=null&&t.remove&&((a=n.current)==null||a.remove())}},[o]),d.useEffect(()=>{var t,a;if((t=n.current)!=null&&t.setOptions){const u=C(e.node.attrs);(a=n.current)==null||a.setOptions(u)}},[n,e.node.attrs]),r.jsx(s.NodeViewWrapper,{className:s.clsx(p.wrap,"render-wrapper"),children:r.jsx("div",{onClick:A,ref:o,className:s.clsx("richtext-node-container richtext-hover-shadow richtext-select-outline richtext-node-code-block !richtext-my-[10px]",{[p.blockInfoEditable]:!c}),children:r.jsxs("div",{className:"richtext-code-block-toolbar",children:[r.jsx("div",{children:r.jsxs(i.Select,{defaultValue:e.node.attrs.language,disabled:!c,onValueChange:t=>{e.updateAttributes({language:t}),l()},children:[r.jsx(i.SelectTrigger,{className:"richtext-h-7 richtext-w-[160px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]",children:r.jsx(i.SelectValue,{placeholder:"Select language"})}),r.jsx(i.SelectContent,{onCloseAutoFocus:t=>t.preventDefault(),children:b==null?void 0:b.map(t=>r.jsx(i.SelectItem,{value:t.value,children:t.label},t.value))})]})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{className:"richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",onClick:m,children:r.jsx(i.IconComponent,{className:"richtext-size-4",name:"Copy"})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{onClick:g,className:s.clsx("richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",{"richtext-bg-[#5a5d5e4f]":e==null?void 0:e.node.attrs.lineNumbers}),children:r.jsx(i.IconComponent,{className:"richtext-size-4",name:"List"})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{onClick:v,className:s.clsx("richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",{"richtext-bg-[#5a5d5e4f]":e==null?void 0:e.node.attrs.wordWrap}),children:r.jsx(i.IconComponent,{className:"richtext-size-4",name:"WrapText"})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{children:r.jsxs(i.Select,{defaultValue:e.node.attrs.tabSize,disabled:!c,onValueChange:t=>{e.updateAttributes({tabSize:t}),l()},children:[r.jsx(i.SelectTrigger,{className:"richtext-h-7 richtext-w-[60px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]",children:r.jsx(i.IconComponent,{className:"richtext-size-4",name:"IndentIncrease"})}),r.jsx(i.SelectContent,{onCloseAutoFocus:t=>t.preventDefault(),children:f==null?void 0:f.map(t=>r.jsx(i.SelectItem,{value:t,children:t},t))})]})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{className:"richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",onClick:x,children:r.jsx(i.IconComponent,{className:"richtext-size-4",name:"Trash2"})})]})})})}const N=/^`{3}([a-z]+)?\s$/,y=/^~{3}([a-z]+)?\s$/,q=s.Node3.create({name:"codeBlock",group:"block",atom:!0,content:"text*",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),languages:[],button:({editor:c,t:o})=>({componentProps:{action:()=>c.commands.setCodeBlock({}),isActive:()=>c.isActive("codeBlock"),disabled:!1,icon:"Code2",tooltip:o("editor.codeblock.tooltip")}})}},addAttributes(){return{code:{default:"",parseHTML:e=>e.textContent||""},language:{default:"plaintext"},lineNumbers:{default:!0},wordWrap:{default:!1},tabSize:{default:2},shouldFocus:{default:!0,parseHTML:()=>!1,renderHTML:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({code:e.textContent||""})},{tag:"pre code",preserveWhitespace:"full",getAttrs:e=>({code:e.textContent||""})}]},renderHTML({HTMLAttributes:e,node:c}){var x;const o=c.attrs.code||((x=c.content.firstChild)==null?void 0:x.text)||"";return["pre",s.mergeAttributes(this.options.HTMLAttributes,e),["code",{},o]]},addNodeView(){return s.ReactNodeViewRenderer(W)},addCommands(){return{setCodeBlock:e=>({commands:c})=>c.insertContent({type:this.name,attrs:{...e,shouldFocus:!0}})}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.setCodeBlock({})}},addInputRules(){return[s.textblockTypeInputRule({find:N,type:this.type,getAttributes:e=>({language:e[1]})}),s.textblockTypeInputRule({find:y,type:this.type,getAttributes:e=>({language:e[1]})})]}});exports.CodeBlock=q;exports.RichTextCodeBlock=z;exports.backtickInputRegex=N;exports.tildeInputRegex=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./clsx-CXbNJWDD.cjs"),r=require("react/jsx-runtime"),u=require("./index-CUnpdrCy.cjs"),x=require("react");require("./theme.cjs");const S=require("prism-code-editor-lightweight"),p=require("prism-code-editor-lightweight/commands"),T=require("prism-code-editor-lightweight/cursor"),I=require("prism-code-editor-lightweight/guides"),B=require("prism-code-editor-lightweight/highlight-brackets"),R=require("prism-code-editor-lightweight/match-brackets"),E=require("prism-code-editor-lightweight/match-tags"),s=require("./select-BqlizSg4.cjs"),z=require("./delete-node-CosiBes5.cjs");require("prism-code-editor-lightweight/prism/languages/bash");require("prism-code-editor-lightweight/prism/languages/css");require("prism-code-editor-lightweight/prism/languages/css-extras");require("prism-code-editor-lightweight/prism/languages/ini");require("prism-code-editor-lightweight/prism/languages/kotlin");require("prism-code-editor-lightweight/prism/languages/xml");require("prism-code-editor-lightweight/prism/languages/markup");require("prism-code-editor-lightweight/prism/languages/r");require("prism-code-editor-lightweight/prism/languages/basic");require("prism-code-editor-lightweight/prism/languages/vbnet");require("prism-code-editor-lightweight/prism/languages/c");require("prism-code-editor-lightweight/prism/languages/opencl");require("prism-code-editor-lightweight/prism/languages/diff");require("prism-code-editor-lightweight/prism/languages/java");require("prism-code-editor-lightweight/prism/languages/less");require("prism-code-editor-lightweight/prism/languages/objectivec");require("prism-code-editor-lightweight/prism/languages/ruby");require("prism-code-editor-lightweight/prism/languages/sql");require("prism-code-editor-lightweight/prism/languages/wasm");require("prism-code-editor-lightweight/prism/languages/cpp");require("prism-code-editor-lightweight/prism/languages/go");require("prism-code-editor-lightweight/prism/languages/javascript");require("prism-code-editor-lightweight/prism/languages/js-templates");require("prism-code-editor-lightweight/prism/languages/jsx");require("prism-code-editor-lightweight/prism/languages/lua");require("prism-code-editor-lightweight/prism/languages/perl");require("prism-code-editor-lightweight/prism/languages/python");require("prism-code-editor-lightweight/prism/languages/rust");require("prism-code-editor-lightweight/prism/languages/swift");require("prism-code-editor-lightweight/prism/languages/clike");require("prism-code-editor-lightweight/prism/languages/csharp");require("prism-code-editor-lightweight/prism/languages/graphql");require("prism-code-editor-lightweight/prism/languages/json");require("prism-code-editor-lightweight/prism/languages/makefile");require("prism-code-editor-lightweight/prism/languages/scss");require("prism-code-editor-lightweight/prism/languages/typescript");require("prism-code-editor-lightweight/prism/languages/tsx");require("prism-code-editor-lightweight/prism/languages/yaml");require("prism-code-editor-lightweight/prism/languages/regex");require("prism-code-editor-lightweight/prism/languages/php");require("prism-code-editor-lightweight/prism/languages/markdown");function L(){const e=u.useButtonProps(C.name),{icon:a=void 0,tooltip:n=void 0,tooltipOptions:h={},action:c=void 0,isActive:m=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:o,disabled:b,update:v}=u.useToggleActive(m),f=()=>{b||c&&(c(),v())};return e?r.jsx(u.ActionButton,{action:f,dataState:o,disabled:b,icon:a,tooltip:n,tooltipOptions:h}):r.jsx(r.Fragment,{})}const M="_wrap_1x3wi_1",W="_blockInfoEditable_1x3wi_30",N={wrap:M,blockInfoEditable:W},g=[{value:"plaintext",label:"plaintext"},{value:"javascript",label:"JavaScript"},{value:"typescript",label:"TypeScript"},{value:"html",label:"HTML"},{value:"css",label:"CSS"},{value:"python",label:"Python"},{value:"java",label:"Java"},{value:"cpp",label:"C++"},{value:"go",label:"Go"},{value:"rust",label:"Rust"},{value:"sql",label:"SQL"},{value:"json",label:"JSON"},{value:"yaml",label:"YAML"},{value:"markdown",label:"Markdown"},{value:"bash",label:"Bash"},{value:"php",label:"PHP"}],q=[2,4,8];function H(e){const a=u.useEditableEditor(),n=x.useRef(null),h=x.useCallback(()=>z.deleteNode(C.name,e==null?void 0:e.editor),[e==null?void 0:e.editor]),c=x.useRef(null),m=e.node.attrs.code||e.node.textContent||"",o=x.useCallback(t=>{t==null||t.stopPropagation(),setTimeout(()=>{var i,d,j;(j=(d=(i=c.current)==null?void 0:i.textarea)==null?void 0:d.focus)==null||j.call(d)},0)},[]),b=async()=>{if(m)try{if(navigator.clipboard)await navigator.clipboard.writeText(m);else{const t=document.createElement("textarea");t.value=m,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}}catch(t){console.error("Error:",t)}finally{o()}},v=()=>{e.updateAttributes({lineNumbers:!e.node.attrs.lineNumbers}),o()},f=()=>{e.updateAttributes({wordWrap:!e.node.attrs.wordWrap}),o()},k=t=>{const i={...t};return i.language&&!g.some(d=>d.value===i.language)&&(i.language="plaintext",e.updateAttributes({language:"plaintext"})),i},w=x.useCallback(t=>{o(t)},[o]);return x.useEffect(()=>{if(n.current){const t=k(e.node.attrs);c.current=S.createEditor(n.current,{readOnly:!a,language:t.language||"plaintext",tabSize:t.tabSize??2,lineNumbers:t.lineNumbers??!0,wordWrap:t.wordWrap??!1,value:m,rtl:!1,onUpdate(i){queueMicrotask(()=>{e.updateAttributes({code:i})})}}),c.current.addExtensions(R.matchBrackets(),E.matchTags(),I.indentGuides(),B.highlightBracketPairs(),T.cursorPosition(),p.defaultCommands(),p.editHistory()),e.node.attrs.shouldFocus&&setTimeout(()=>{o(),e.updateAttributes({shouldFocus:!1})},0)}return()=>{var t,i;(t=c.current)!=null&&t.remove&&((i=c.current)==null||i.remove())}},[n]),x.useEffect(()=>{var t,i;if((t=c.current)!=null&&t.setOptions){const d=k(e.node.attrs);(i=c.current)==null||i.setOptions(d)}},[c,e.node.attrs]),r.jsx(l.NodeViewWrapper,{className:l.clsx(N.wrap,"render-wrapper"),children:r.jsx("div",{onClick:w,ref:n,className:l.clsx("richtext-node-container richtext-hover-shadow richtext-select-outline richtext-node-code-block !richtext-my-[10px]",{[N.blockInfoEditable]:!a}),children:r.jsxs("div",{className:"richtext-code-block-toolbar",children:[r.jsx("div",{children:r.jsxs(s.Select,{defaultValue:e.node.attrs.language,disabled:!a,onValueChange:t=>{e.updateAttributes({language:t}),o()},children:[r.jsx(s.SelectTrigger,{className:"richtext-h-7 richtext-w-[160px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]",children:r.jsx(s.SelectValue,{placeholder:"Select language"})}),r.jsx(s.SelectContent,{onCloseAutoFocus:t=>t.preventDefault(),children:g==null?void 0:g.map(t=>r.jsx(s.SelectItem,{value:t.value,children:t.label},t.value))})]})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{className:"richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",onClick:b,children:r.jsx(u.IconComponent,{className:"richtext-size-4",name:"Copy"})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{onClick:v,className:l.clsx("richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",{"richtext-bg-[#5a5d5e4f]":e==null?void 0:e.node.attrs.lineNumbers}),children:r.jsx(u.IconComponent,{className:"richtext-size-4",name:"List"})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{onClick:f,className:l.clsx("richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",{"richtext-bg-[#5a5d5e4f]":e==null?void 0:e.node.attrs.wordWrap}),children:r.jsx(u.IconComponent,{className:"richtext-size-4",name:"WrapText"})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{children:r.jsxs(s.Select,{defaultValue:e.node.attrs.tabSize,disabled:!a,onValueChange:t=>{e.updateAttributes({tabSize:t}),o()},children:[r.jsx(s.SelectTrigger,{className:"richtext-h-7 richtext-w-[60px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]",children:r.jsx(u.IconComponent,{className:"richtext-size-4",name:"IndentIncrease"})}),r.jsx(s.SelectContent,{onCloseAutoFocus:t=>t.preventDefault(),children:q==null?void 0:q.map(t=>r.jsx(s.SelectItem,{value:t,children:t},t))})]})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{className:"richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",onClick:h,children:r.jsx(u.IconComponent,{className:"richtext-size-4",name:"Trash2"})})]})})})}const y=/^`{3}([a-z]+)?\s$/,A=/^~{3}([a-z]+)?\s$/,C=l.Node3.create({name:"codeBlock",group:"block",atom:!0,content:"text*",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),languages:[],button:({editor:a,t:n})=>({componentProps:{action:()=>a.commands.setCodeBlock({}),isActive:()=>a.isActive("codeBlock"),disabled:!1,icon:"Code2",tooltip:n("editor.codeblock.tooltip")}})}},addAttributes(){return{code:{default:"",parseHTML:e=>e.textContent||""},language:{default:"plaintext"},lineNumbers:{default:!0},wordWrap:{default:!1},tabSize:{default:2},shouldFocus:{default:!0,parseHTML:()=>!1,renderHTML:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({code:e.textContent||""})},{tag:"pre code",preserveWhitespace:"full",getAttrs:e=>({code:e.textContent||""})}]},renderHTML({HTMLAttributes:e,node:a}){var h;const n=a.attrs.code||((h=a.content.firstChild)==null?void 0:h.text)||"";return["pre",l.mergeAttributes(this.options.HTMLAttributes,e),["code",{},n]]},addNodeView(){return l.ReactNodeViewRenderer(H)},addCommands(){return{setCodeBlock:e=>({commands:a})=>a.insertContent({type:this.name,attrs:{...e,shouldFocus:!0}})}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.setCodeBlock({})}},addInputRules(){return[l.textblockTypeInputRule({find:y,type:this.type,getAttributes:e=>({language:e[1]})}),l.textblockTypeInputRule({find:A,type:this.type,getAttributes:e=>({language:e[1]})})]}});exports.CodeBlock=C;exports.RichTextCodeBlock=L;exports.backtickInputRegex=y;exports.tildeInputRegex=A;
package/lib/CodeBlock.js CHANGED
@@ -1,15 +1,16 @@
1
1
  import { h as L, j as h, N as M, t as k, k as W, m as j } from "./clsx-BUPZHhq3.js";
2
2
  import { jsx as r, Fragment as R, jsxs as f } from "react/jsx-runtime";
3
- import { u as H, d as V, A as P, G as F, S as y, p as A, q as O, r as w, s as S, I as u } from "./index-CnKgiZFQ.js";
4
- import { useRef as T, useCallback as v, useEffect as E } from "react";
3
+ import { u as H, d as V, A as P, x as F, I as u } from "./index-CelRl0mr.js";
4
+ import { useRef as y, useCallback as v, useEffect as A } from "react";
5
5
  import "./theme.js";
6
- import { createEditor as _ } from "prism-code-editor-lightweight";
7
- import { defaultCommands as q, editHistory as G } from "prism-code-editor-lightweight/commands";
8
- import { cursorPosition as J } from "prism-code-editor-lightweight/cursor";
6
+ import { createEditor as O } from "prism-code-editor-lightweight";
7
+ import { defaultCommands as _, editHistory as J } from "prism-code-editor-lightweight/commands";
8
+ import { cursorPosition as q } from "prism-code-editor-lightweight/cursor";
9
9
  import { indentGuides as D } from "prism-code-editor-lightweight/guides";
10
- import { highlightBracketPairs as U } from "prism-code-editor-lightweight/highlight-brackets";
11
- import { matchBrackets as $ } from "prism-code-editor-lightweight/match-brackets";
12
- import { matchTags as K } from "prism-code-editor-lightweight/match-tags";
10
+ import { highlightBracketPairs as G } from "prism-code-editor-lightweight/highlight-brackets";
11
+ import { matchBrackets as U } from "prism-code-editor-lightweight/match-brackets";
12
+ import { matchTags as $ } from "prism-code-editor-lightweight/match-tags";
13
+ import { S as w, a as S, b as K, c as T, d as E } from "./select-Dc3RkAhQ.js";
13
14
  import { d as Q } from "./delete-node-eQHsyyhR.js";
14
15
  import "prism-code-editor-lightweight/prism/languages/bash";
15
16
  import "prism-code-editor-lightweight/prism/languages/css";
@@ -52,20 +53,20 @@ import "prism-code-editor-lightweight/prism/languages/yaml";
52
53
  import "prism-code-editor-lightweight/prism/languages/regex";
53
54
  import "prism-code-editor-lightweight/prism/languages/php";
54
55
  import "prism-code-editor-lightweight/prism/languages/markdown";
55
- function rt() {
56
+ function at() {
56
57
  const e = H(B.name), {
57
58
  icon: i = void 0,
58
59
  tooltip: n = void 0,
59
60
  tooltipOptions: s = {},
60
61
  action: o = void 0,
61
62
  isActive: d = void 0
62
- } = (e == null ? void 0 : e.componentProps) ?? {}, { dataState: c, disabled: m, update: p } = V(d), b = () => {
63
- m || o && (o(), p());
63
+ } = (e == null ? void 0 : e.componentProps) ?? {}, { dataState: c, disabled: m, update: b } = V(d), p = () => {
64
+ m || o && (o(), b());
64
65
  };
65
66
  return e ? /* @__PURE__ */ r(
66
67
  P,
67
68
  {
68
- action: b,
69
+ action: p,
69
70
  dataState: c,
70
71
  disabled: m,
71
72
  icon: i,
@@ -96,7 +97,7 @@ const Y = "_wrap_1x3wi_1", X = "_blockInfoEditable_1x3wi_30", z = {
96
97
  { value: "php", label: "PHP" }
97
98
  ], g = [2, 4, 8];
98
99
  function Z(e) {
99
- const i = F(), n = T(null), s = v(() => Q(B.name, e == null ? void 0 : e.editor), [e == null ? void 0 : e.editor]), o = T(null), d = e.node.attrs.code || e.node.textContent || "", c = v((t) => {
100
+ const i = F(), n = y(null), s = v(() => Q(B.name, e == null ? void 0 : e.editor), [e == null ? void 0 : e.editor]), o = y(null), d = e.node.attrs.code || e.node.textContent || "", c = v((t) => {
100
101
  t == null || t.stopPropagation(), setTimeout(() => {
101
102
  var a, l, N;
102
103
  (N = (l = (a = o.current) == null ? void 0 : a.textarea) == null ? void 0 : l.focus) == null || N.call(l);
@@ -115,11 +116,11 @@ function Z(e) {
115
116
  } finally {
116
117
  c();
117
118
  }
118
- }, p = () => {
119
+ }, b = () => {
119
120
  e.updateAttributes({
120
121
  lineNumbers: !e.node.attrs.lineNumbers
121
122
  }), c();
122
- }, b = () => {
123
+ }, p = () => {
123
124
  e.updateAttributes({
124
125
  wordWrap: !e.node.attrs.wordWrap
125
126
  }), c();
@@ -134,10 +135,10 @@ function Z(e) {
134
135
  },
135
136
  [c]
136
137
  );
137
- return E(() => {
138
+ return A(() => {
138
139
  if (n.current) {
139
140
  const t = C(e.node.attrs);
140
- o.current = _(n.current, {
141
+ o.current = O(n.current, {
141
142
  readOnly: !i,
142
143
  language: t.language || "plaintext",
143
144
  tabSize: t.tabSize ?? 2,
@@ -151,13 +152,13 @@ function Z(e) {
151
152
  });
152
153
  }
153
154
  }), o.current.addExtensions(
155
+ U(),
154
156
  $(),
155
- K(),
156
157
  D(),
157
- U(),
158
- J(),
158
+ G(),
159
159
  q(),
160
- G()
160
+ _(),
161
+ J()
161
162
  ), e.node.attrs.shouldFocus && setTimeout(() => {
162
163
  c(), e.updateAttributes({
163
164
  shouldFocus: !1
@@ -168,7 +169,7 @@ function Z(e) {
168
169
  var t, a;
169
170
  (t = o.current) != null && t.remove && ((a = o.current) == null || a.remove());
170
171
  };
171
- }, [n]), E(() => {
172
+ }, [n]), A(() => {
172
173
  var t, a;
173
174
  if ((t = o.current) != null && t.setOptions) {
174
175
  const l = C(e.node.attrs);
@@ -187,7 +188,7 @@ function Z(e) {
187
188
  ),
188
189
  children: /* @__PURE__ */ f("div", { className: "richtext-code-block-toolbar", children: [
189
190
  /* @__PURE__ */ r("div", { children: /* @__PURE__ */ f(
190
- y,
191
+ w,
191
192
  {
192
193
  defaultValue: e.node.attrs.language,
193
194
  disabled: !i,
@@ -197,8 +198,8 @@ function Z(e) {
197
198
  }), c();
198
199
  },
199
200
  children: [
200
- /* @__PURE__ */ r(A, { className: "richtext-h-7 richtext-w-[160px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]", children: /* @__PURE__ */ r(O, { placeholder: "Select language" }) }),
201
- /* @__PURE__ */ r(w, { onCloseAutoFocus: (t) => t.preventDefault(), children: x == null ? void 0 : x.map((t) => /* @__PURE__ */ r(S, { value: t.value, children: t.label }, t.value)) })
201
+ /* @__PURE__ */ r(S, { className: "richtext-h-7 richtext-w-[160px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]", children: /* @__PURE__ */ r(K, { placeholder: "Select language" }) }),
202
+ /* @__PURE__ */ r(T, { onCloseAutoFocus: (t) => t.preventDefault(), children: x == null ? void 0 : x.map((t) => /* @__PURE__ */ r(E, { value: t.value, children: t.label }, t.value)) })
202
203
  ]
203
204
  }
204
205
  ) }),
@@ -215,7 +216,7 @@ function Z(e) {
215
216
  /* @__PURE__ */ r(
216
217
  "div",
217
218
  {
218
- onClick: p,
219
+ onClick: b,
219
220
  className: h(
220
221
  "richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",
221
222
  {
@@ -229,7 +230,7 @@ function Z(e) {
229
230
  /* @__PURE__ */ r(
230
231
  "div",
231
232
  {
232
- onClick: b,
233
+ onClick: p,
233
234
  className: h(
234
235
  "richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",
235
236
  {
@@ -241,7 +242,7 @@ function Z(e) {
241
242
  ),
242
243
  /* @__PURE__ */ r("div", { className: "toolbar-divider" }),
243
244
  /* @__PURE__ */ r("div", { children: /* @__PURE__ */ f(
244
- y,
245
+ w,
245
246
  {
246
247
  defaultValue: e.node.attrs.tabSize,
247
248
  disabled: !i,
@@ -251,8 +252,8 @@ function Z(e) {
251
252
  }), c();
252
253
  },
253
254
  children: [
254
- /* @__PURE__ */ r(A, { className: "richtext-h-7 richtext-w-[60px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]", children: /* @__PURE__ */ r(u, { className: "richtext-size-4", name: "IndentIncrease" }) }),
255
- /* @__PURE__ */ r(w, { onCloseAutoFocus: (t) => t.preventDefault(), children: g == null ? void 0 : g.map((t) => /* @__PURE__ */ r(S, { value: t, children: t }, t)) })
255
+ /* @__PURE__ */ r(S, { className: "richtext-h-7 richtext-w-[60px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]", children: /* @__PURE__ */ r(u, { className: "richtext-size-4", name: "IndentIncrease" }) }),
256
+ /* @__PURE__ */ r(T, { onCloseAutoFocus: (t) => t.preventDefault(), children: g == null ? void 0 : g.map((t) => /* @__PURE__ */ r(E, { value: t, children: t }, t)) })
256
257
  ]
257
258
  }
258
259
  ) }),
@@ -382,7 +383,7 @@ const ee = /^`{3}([a-z]+)?\s$/, te = /^~{3}([a-z]+)?\s$/, B = /* @__PURE__ */ M.
382
383
  });
383
384
  export {
384
385
  B as CodeBlock,
385
- rt as RichTextCodeBlock,
386
+ at as RichTextCodeBlock,
386
387
  ee as backtickInputRegex,
387
388
  te as tildeInputRegex
388
389
  };
package/lib/CodeView.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),c=require("./index-BynXHtjJ.cjs");require("react");require("./theme.cjs");function v(){const e=c.useButtonProps(a.name),{icon:t=void 0,tooltip:o=void 0,shortcutKeys:i=void 0,tooltipOptions:d={},action:s=void 0,isActive:l=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:u,disabled:r,update:p}=c.useToggleActive(l),g=()=>{r||s&&(s(),p())};return e?n.jsx(c.ActionButton,{action:g,dataState:u,disabled:r,icon:t,shortcutKeys:i,tooltip:o,tooltipOptions:d}):n.jsx(n.Fragment,{})}const a=m.Extension.create({name:"codeView",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:t,t:o}){return{componentProps:{action:()=>{t.commands.toggleCodeView()},isActive:()=>t.storage.codeView.isActive,disabled:!1,icon:"Html",tooltip:o("editor.codeView.tooltip")||"View HTML Code",customClass:"tiptap-code-view-button"}}}}},addStorage(){return{isActive:!1,originalContent:""}},addCommands(){return{toggleCodeView:()=>({editor:e})=>{const t=e.storage.codeView.isActive;if(t)e.commands.setContent(e.getText());else{const o=e.getHTML();e.storage.codeView.originalContent=o;const i=o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");e.commands.setContent(`<div class="tiptap-code-view-wrapper">${i}</div>`)}return e.storage.codeView.isActive=!t,!0}}}});exports.CodeView=a;exports.RichTextCodeView=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),c=require("./index-CUnpdrCy.cjs");require("react");require("./theme.cjs");function v(){const e=c.useButtonProps(a.name),{icon:t=void 0,tooltip:o=void 0,shortcutKeys:i=void 0,tooltipOptions:d={},action:s=void 0,isActive:l=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:u,disabled:r,update:p}=c.useToggleActive(l),g=()=>{r||s&&(s(),p())};return e?n.jsx(c.ActionButton,{action:g,dataState:u,disabled:r,icon:t,shortcutKeys:i,tooltip:o,tooltipOptions:d}):n.jsx(n.Fragment,{})}const a=m.Extension.create({name:"codeView",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:t,t:o}){return{componentProps:{action:()=>{t.commands.toggleCodeView()},isActive:()=>t.storage.codeView.isActive,disabled:!1,icon:"Html",tooltip:o("editor.codeView.tooltip")||"View HTML Code",customClass:"tiptap-code-view-button"}}}}},addStorage(){return{isActive:!1,originalContent:""}},addCommands(){return{toggleCodeView:()=>({editor:e})=>{const t=e.storage.codeView.isActive;if(t)e.commands.setContent(e.getText());else{const o=e.getHTML();e.storage.codeView.originalContent=o;const i=o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");e.commands.setContent(`<div class="tiptap-code-view-wrapper">${i}</div>`)}return e.storage.codeView.isActive=!t,!0}}}});exports.CodeView=a;exports.RichTextCodeView=v;
package/lib/CodeView.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { E as l } from "./clsx-BUPZHhq3.js";
2
2
  import { jsx as c, Fragment as g } from "react/jsx-runtime";
3
- import { u, d as v, A as w } from "./index-CnKgiZFQ.js";
3
+ import { u, d as v, A as w } from "./index-CelRl0mr.js";
4
4
  import "react";
5
5
  import "./theme.js";
6
6
  function h() {
package/lib/Color.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-CjhjjJsN.cjs"),t=require("react/jsx-runtime"),d=require("react"),l=require("./index-BynXHtjJ.cjs"),g=require("./separator-CoQaQmFK.cjs");require("./theme.cjs");function v({fill:e}){return t.jsx("svg",{height:"18px",version:"1.1",viewBox:"0 0 240 240",width:"18px",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:1,children:t.jsx("g",{transform:"translate(0.000000, 0.500000)",children:t.jsxs("g",{transform:"translate(39.000000, 17.353553)",children:[t.jsx("path",{d:"M11,201.146447 L167,201.146447 C173.075132,201.146447 178,206.071314 178,212.146447 C178,218.221579 173.075132,223.146447 167,223.146447 L11,223.146447 C4.92486775,223.146447 7.43989126e-16,218.221579 0,212.146447 C-7.43989126e-16,206.071314 4.92486775,201.146447 11,201.146447 Z",fill:typeof e=="string"?e:"#000",fillRule:"evenodd"}),t.jsx("path",{d:"M72.3425855,16.8295583 C75.799482,7.50883712 86.1577877,2.75526801 95.4785089,6.21216449 C100.284516,7.99463061 104.096358,11.7387855 105.968745,16.4968188 L106.112518,16.8745422 L159.385152,161.694068 C161.291848,166.877345 158.635655,172.624903 153.452378,174.531599 C148.358469,176.405421 142.719567,173.872338 140.716873,168.864661 L140.614848,168.598825 L89.211,28.86 L37.3759214,168.623816 C35.4885354,173.712715 29.8981043,176.351047 24.7909589,174.617647 L24.5226307,174.522368 C19.4337312,172.634982 16.7953993,167.044551 18.5287999,161.937406 L18.6240786,161.669077 L72.3425855,16.8295583 Z",fill:"currentColor",fillRule:"nonzero"}),t.jsx("path",{d:"M121,103.146447 C126.522847,103.146447 131,107.623599 131,113.146447 C131,118.575687 126.673329,122.994378 121.279905,123.142605 L121,123.146447 L55,123.146447 C49.4771525,123.146447 45,118.669294 45,113.146447 C45,107.717207 49.3266708,103.298515 54.7200952,103.150288 L55,103.146447 L121,103.146447 Z",fill:"currentColor",fillRule:"nonzero"})]})})})})}function j(){const e=l.useButtonProps(C.name),{tooltip:o=void 0,isActive:s=void 0,defaultColor:r=void 0,colors:n,action:i}=(e==null?void 0:e.componentProps)??{},{disabled:c,dataState:u}=l.useActive(s),[f,a]=d.useState(r);d.useEffect(()=>{a(u)},[u]);function x(h){c||i&&(i==null||i(h),a(h))}return e?t.jsx(g.ColorPicker,{colors:n,disabled:c,onChange:x,value:f,children:t.jsx(l.ActionButton,{disabled:c,tooltip:o,children:t.jsxs("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[4px] richtext-text-sm",children:[t.jsx(v,{fill:u}),t.jsx(l.IconComponent,{className:"!richtext-h-3 !richtext-w-3 richtext-text-zinc-500",name:"MenuDown"})]})})}):t.jsx(t.Fragment,{})}const C=p.Color.extend({addStorage(){return{currentColor:this.options.defaultColor||void 0}},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:o,t:s,extension:r}){return{componentProps:{colors:r.options.colors,defaultColor:r.options.defaultColor,action:n=>{if(typeof n=="string"){o.storage.color.currentColor=n,o.chain().focus().setColor(n).run();return}o.chain().focus().unsetColor().run()},isActive:()=>{const{color:n}=o.getAttributes("textStyle");return n},disabled:!1,shortcutKeys:r.options.shortcutKeys??["⇧","alt","C"],tooltip:s("editor.color.tooltip")}}}}},addKeyboardShortcuts(){var e;return{...(e=this.parent)==null?void 0:e.call(this),"Alt-Shift-c":()=>{const o=this.storage.currentColor||this.options.defaultColor;if(!o){const{color:r}=this.editor.getAttributes("textStyle");return r?this.editor.chain().focus().unsetColor().run():!1}return this.editor.isActive("textStyle",{color:o})?this.editor.chain().focus().unsetColor().run():this.editor.chain().focus().setColor(o).run()}}}});exports.Color=C;exports.RichTextColor=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-CjhjjJsN.cjs"),t=require("react/jsx-runtime"),d=require("react"),l=require("./index-CUnpdrCy.cjs"),g=require("./separator-DuP4NoiV.cjs");require("./theme.cjs");function v({fill:e}){return t.jsx("svg",{height:"18px",version:"1.1",viewBox:"0 0 240 240",width:"18px",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:1,children:t.jsx("g",{transform:"translate(0.000000, 0.500000)",children:t.jsxs("g",{transform:"translate(39.000000, 17.353553)",children:[t.jsx("path",{d:"M11,201.146447 L167,201.146447 C173.075132,201.146447 178,206.071314 178,212.146447 C178,218.221579 173.075132,223.146447 167,223.146447 L11,223.146447 C4.92486775,223.146447 7.43989126e-16,218.221579 0,212.146447 C-7.43989126e-16,206.071314 4.92486775,201.146447 11,201.146447 Z",fill:typeof e=="string"?e:"#000",fillRule:"evenodd"}),t.jsx("path",{d:"M72.3425855,16.8295583 C75.799482,7.50883712 86.1577877,2.75526801 95.4785089,6.21216449 C100.284516,7.99463061 104.096358,11.7387855 105.968745,16.4968188 L106.112518,16.8745422 L159.385152,161.694068 C161.291848,166.877345 158.635655,172.624903 153.452378,174.531599 C148.358469,176.405421 142.719567,173.872338 140.716873,168.864661 L140.614848,168.598825 L89.211,28.86 L37.3759214,168.623816 C35.4885354,173.712715 29.8981043,176.351047 24.7909589,174.617647 L24.5226307,174.522368 C19.4337312,172.634982 16.7953993,167.044551 18.5287999,161.937406 L18.6240786,161.669077 L72.3425855,16.8295583 Z",fill:"currentColor",fillRule:"nonzero"}),t.jsx("path",{d:"M121,103.146447 C126.522847,103.146447 131,107.623599 131,113.146447 C131,118.575687 126.673329,122.994378 121.279905,123.142605 L121,123.146447 L55,123.146447 C49.4771525,123.146447 45,118.669294 45,113.146447 C45,107.717207 49.3266708,103.298515 54.7200952,103.150288 L55,103.146447 L121,103.146447 Z",fill:"currentColor",fillRule:"nonzero"})]})})})})}function j(){const e=l.useButtonProps(C.name),{tooltip:o=void 0,isActive:s=void 0,defaultColor:r=void 0,colors:n,action:i}=(e==null?void 0:e.componentProps)??{},{disabled:c,dataState:u}=l.useActive(s),[f,a]=d.useState(r);d.useEffect(()=>{a(u)},[u]);function x(h){c||i&&(i==null||i(h),a(h))}return e?t.jsx(g.ColorPicker,{colors:n,disabled:c,onChange:x,value:f,children:t.jsx(l.ActionButton,{disabled:c,tooltip:o,children:t.jsxs("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[4px] richtext-text-sm",children:[t.jsx(v,{fill:u}),t.jsx(l.IconComponent,{className:"!richtext-h-3 !richtext-w-3 richtext-text-zinc-500",name:"MenuDown"})]})})}):t.jsx(t.Fragment,{})}const C=p.Color.extend({addStorage(){return{currentColor:this.options.defaultColor||void 0}},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:o,t:s,extension:r}){return{componentProps:{colors:r.options.colors,defaultColor:r.options.defaultColor,action:n=>{if(typeof n=="string"){o.storage.color.currentColor=n,o.chain().focus().setColor(n).run();return}o.chain().focus().unsetColor().run()},isActive:()=>{const{color:n}=o.getAttributes("textStyle");return n},disabled:!1,shortcutKeys:r.options.shortcutKeys??["⇧","alt","C"],tooltip:s("editor.color.tooltip")}}}}},addKeyboardShortcuts(){var e;return{...(e=this.parent)==null?void 0:e.call(this),"Alt-Shift-c":()=>{const o=this.storage.currentColor||this.options.defaultColor;if(!o){const{color:r}=this.editor.getAttributes("textStyle");return r?this.editor.chain().focus().unsetColor().run():!1}return this.editor.isActive("textStyle",{color:o})?this.editor.chain().focus().unsetColor().run():this.editor.chain().focus().setColor(o).run()}}}});exports.Color=C;exports.RichTextColor=j;
package/lib/Color.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { C as d } from "./index-Dl3OjzmR.js";
2
2
  import { jsx as o, jsxs as h, Fragment as p } from "react/jsx-runtime";
3
3
  import { useState as x, useEffect as m } from "react";
4
- import { u as g, e as v, A as L, I as A } from "./index-CnKgiZFQ.js";
5
- import { C as y } from "./separator-D-fyzbfx.js";
4
+ import { u as g, e as v, A as L, I as A } from "./index-CelRl0mr.js";
5
+ import { C as y } from "./separator-DWLSmuSh.js";
6
6
  import "./theme.js";
7
7
  function S({ fill: t }) {
8
8
  return /* @__PURE__ */ o(
package/lib/Column.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./clsx-CXbNJWDD.cjs"),x=require("@tiptap/pm/state"),A=require("@tiptap/pm/model"),f=require("react/jsx-runtime"),h=require("./index-BynXHtjJ.cjs");require("react");require("./theme.cjs");function v(e,t,r=null){return r?e.createChecked({index:t},r):e.createAndFill({index:t})}function M(e){if(e.cached.columnsNodeTypes)return e.cached.columnsNodeTypes;const t={columns:e.nodes.columns,column:e.nodes.column};return e.cached.columnsNodeTypes=t,t}function H(e,t,r=null){const n=M(e),c=[];for(let o=0;o<t;o+=1){const s=v(n.column,o,r);s&&c.push(s)}return n.columns.createChecked({cols:t},c)}function C({state:e,dispatch:t,type:r}){const n=u.findParentNode(o=>o.type.name===b.name)(e.selection),c=u.findParentNode(o=>o.type.name===T.name)(e.selection);if(t&&n&&c){const o=n.node,s=c.node.attrs.index,i=o.toJSON();let l=s;r==="delete"?(l=s-1,i.content.splice(s,1)):(l=r==="addBefore"?s:s+1,i.content.splice(l,0,{type:"column",attrs:{index:s},content:[{type:"paragraph"}]})),i.attrs.cols=i.content.length,i.content.forEach((m,y)=>{m.attrs.index=y});const d=A.Node.fromJSON(e.schema,i);let a=n.pos;d.content.forEach((m,y,N)=>{N<l&&(a+=m.nodeSize)});const p=e.tr.setTime(Date.now());p.replaceWith(n.pos,n.pos+n.node.nodeSize,d).setSelection(x.TextSelection.near(p.doc.resolve(a))),t(p)}return!0}function S({state:e,dispatch:t,type:r}){const n=u.findParentNode(o=>o.type.name===b.name)(e.selection),c=u.findParentNode(o=>o.type.name===T.name)(e.selection);if(t&&n&&c){const o=n.node,s=c.node.attrs.index;let i=0;r==="before"?i=(s-1+o.attrs.cols)%o.attrs.cols:i=(s+1)%o.attrs.cols;let l=n.pos;o.content.forEach((a,p,m)=>{m<i&&(l+=a.nodeSize)});const d=e.tr.setTime(Date.now());return d.setSelection(x.TextSelection.near(d.doc.resolve(l))),t(d),!0}return!1}function O(){const e=h.useButtonProps(g.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:o=void 0,isActive:s=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:i,disabled:l,update:d}=h.useToggleActive(s),a=()=>{l||o&&(o(),d())};return e?f.jsx(h.ActionButton,{action:a,dataState:i,disabled:l,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):f.jsx(f.Fragment,{})}const L=200,g=u.Extension.create({name:"richtextColumnExtension",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r})=>({componentProps:{action:()=>{t.chain().focus().insertColumns({cols:2}).run()},icon:"Columns",tooltip:r("editor.columns.tooltip")}})}}}),T=u.Node3.create({name:"column",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"column"}}},addAttributes(){return{index:{default:0,parseHTML:e=>e.getAttribute("index")}}},parseHTML(){return[{tag:"div[class=column]"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]}}),b=u.Node3.create({name:"columns",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"column{1,}",priority:L,addOptions(){return{HTMLAttributes:{class:"columns"}}},addAttributes(){return{cols:{default:2,parseHTML:e=>e.getAttribute("cols")}}},parseHTML(){return[{tag:"div[class=grid]"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{insertColumns:e=>({tr:t,dispatch:r,editor:n})=>{const c=H(n.schema,e&&e.cols||3);if(r){const o=t.selection.anchor+1;t.replaceSelectionWith(c).scrollIntoView().setSelection(x.TextSelection.near(t.doc.resolve(o)))}return!0},addColBefore:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"addBefore"}),addColAfter:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"addAfter"}),deleteCol:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"delete"})}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>S({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"after"}),"Shift-Tab":()=>S({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"before"})}}});exports.Column=g;exports.ColumnNode=T;exports.MultipleColumnNode=b;exports.RichTextColumn=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./clsx-CXbNJWDD.cjs"),x=require("@tiptap/pm/state"),A=require("@tiptap/pm/model"),f=require("react/jsx-runtime"),h=require("./index-CUnpdrCy.cjs");require("react");require("./theme.cjs");function v(e,t,r=null){return r?e.createChecked({index:t},r):e.createAndFill({index:t})}function M(e){if(e.cached.columnsNodeTypes)return e.cached.columnsNodeTypes;const t={columns:e.nodes.columns,column:e.nodes.column};return e.cached.columnsNodeTypes=t,t}function H(e,t,r=null){const n=M(e),c=[];for(let o=0;o<t;o+=1){const s=v(n.column,o,r);s&&c.push(s)}return n.columns.createChecked({cols:t},c)}function C({state:e,dispatch:t,type:r}){const n=u.findParentNode(o=>o.type.name===b.name)(e.selection),c=u.findParentNode(o=>o.type.name===T.name)(e.selection);if(t&&n&&c){const o=n.node,s=c.node.attrs.index,i=o.toJSON();let l=s;r==="delete"?(l=s-1,i.content.splice(s,1)):(l=r==="addBefore"?s:s+1,i.content.splice(l,0,{type:"column",attrs:{index:s},content:[{type:"paragraph"}]})),i.attrs.cols=i.content.length,i.content.forEach((m,y)=>{m.attrs.index=y});const d=A.Node.fromJSON(e.schema,i);let a=n.pos;d.content.forEach((m,y,N)=>{N<l&&(a+=m.nodeSize)});const p=e.tr.setTime(Date.now());p.replaceWith(n.pos,n.pos+n.node.nodeSize,d).setSelection(x.TextSelection.near(p.doc.resolve(a))),t(p)}return!0}function S({state:e,dispatch:t,type:r}){const n=u.findParentNode(o=>o.type.name===b.name)(e.selection),c=u.findParentNode(o=>o.type.name===T.name)(e.selection);if(t&&n&&c){const o=n.node,s=c.node.attrs.index;let i=0;r==="before"?i=(s-1+o.attrs.cols)%o.attrs.cols:i=(s+1)%o.attrs.cols;let l=n.pos;o.content.forEach((a,p,m)=>{m<i&&(l+=a.nodeSize)});const d=e.tr.setTime(Date.now());return d.setSelection(x.TextSelection.near(d.doc.resolve(l))),t(d),!0}return!1}function O(){const e=h.useButtonProps(g.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:o=void 0,isActive:s=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:i,disabled:l,update:d}=h.useToggleActive(s),a=()=>{l||o&&(o(),d())};return e?f.jsx(h.ActionButton,{action:a,dataState:i,disabled:l,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):f.jsx(f.Fragment,{})}const L=200,g=u.Extension.create({name:"richtextColumnExtension",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r})=>({componentProps:{action:()=>{t.chain().focus().insertColumns({cols:2}).run()},icon:"Columns",tooltip:r("editor.columns.tooltip")}})}}}),T=u.Node3.create({name:"column",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"column"}}},addAttributes(){return{index:{default:0,parseHTML:e=>e.getAttribute("index")}}},parseHTML(){return[{tag:"div[class=column]"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]}}),b=u.Node3.create({name:"columns",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"column{1,}",priority:L,addOptions(){return{HTMLAttributes:{class:"columns"}}},addAttributes(){return{cols:{default:2,parseHTML:e=>e.getAttribute("cols")}}},parseHTML(){return[{tag:"div[class=grid]"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{insertColumns:e=>({tr:t,dispatch:r,editor:n})=>{const c=H(n.schema,e&&e.cols||3);if(r){const o=t.selection.anchor+1;t.replaceSelectionWith(c).scrollIntoView().setSelection(x.TextSelection.near(t.doc.resolve(o)))}return!0},addColBefore:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"addBefore"}),addColAfter:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"addAfter"}),deleteCol:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"delete"})}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>S({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"after"}),"Shift-Tab":()=>S({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"before"})}}});exports.Column=g;exports.ColumnNode=T;exports.MultipleColumnNode=b;exports.RichTextColumn=O;
package/lib/Column.js CHANGED
@@ -2,7 +2,7 @@ import { l as p, E as v, N as b, m as y } from "./clsx-BUPZHhq3.js";
2
2
  import { TextSelection as h } from "@tiptap/pm/state";
3
3
  import { Node as N } from "@tiptap/pm/model";
4
4
  import { jsx as T, Fragment as H } from "react/jsx-runtime";
5
- import { u as M, d as L, A as O } from "./index-CnKgiZFQ.js";
5
+ import { u as M, d as L, A as O } from "./index-CelRl0mr.js";
6
6
  import "react";
7
7
  import "./theme.js";
8
8
  function E(e, t, r = null) {